package com.mtons.mblog.base.model.exception;

import com.mtons.mblog.base.model.result.ResultCode;

/**
 * 业务异常
 * @author lijie
 * @since 2019.01.15
 */
public class ServiceException extends RuntimeException{

    private ResultCode code;

    public ServiceException(ResultCode code, String message) {
        super(message);
        this.code = code;
    }

    public ServiceException(ResultCode code) {
        super(code.getDesc());
        this.code = code;
    }

    public ServiceException(ResultCode code, Throwable cause) {
        super(code.getDesc(), cause);
        this.code = code;
    }

    public ServiceException() {
        super();
    }

    public ServiceException(String message) {
        super(message);
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public ServiceException(Throwable cause) {
        super(cause);
    }

    public ResultCode getcode() {
        return code;
    }

    public void setcode(ResultCode code) {
        this.code = code;
    }

}
